package testIntergration;


import static org.junit.Assert.assertEquals;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import FamilyTherapy.GCWindow;
import FamilyTherapy.Player;

public class testGCWindow_displayAllInfo {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testDisplayAllInfo() {
		GCWindow gwindow = new GCWindow();
		Player[] p ={new Player("a",1),new Player("b",2)};
	
		
		final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
		System.setOut(new PrintStream(outContent));

		gwindow.displayAllInfo(p);
		
		String expected = "---------------------------------------------\n" + 
		"a, You are Grandma\n" + 
		"You have 5 self esteem points.\n" + "\n"+
		"---------------------------------------------" + "\n" +
		"b, You are Father\n"  +
		"You have 5 self esteem points.\n" + "\n"+
		"=============================================\n";
		
		assertEquals(expected,outContent.toString());

	}


}
